package com.norbitltd.guavaleaves.java.lang;

import java.util.Date;
import java.util.Locale;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;

import com.google.common.base.Function;

public class StringFunctions extends ObjectFunctions {

	/**
	 * @see org.apache.commons.lang3.StringUtils.abbreviate
	 */
	public static Function<String, String> abbreviate(final int maxWidth) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.abbreviate(input, maxWidth);
			}
		};
	}

	/**
	 * @see org.apache.commons.lang3.StringUtils.abbreviate
	 */
	public static Function<String, String> abbreviate(final int offset, final int maxWidth) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.abbreviate(input, offset, maxWidth);
			}
		};
	}

	/**
	 * @see org.apache.commons.lang3.StringUtils.abbreviateMiddle 
	 */
	public static Function<String, String> abbreviateMiddle(final String middle,
			final int maxWidth) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.abbreviateMiddle(input, middle, maxWidth);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.capitalize 
	 */
	public static Function<String, String> capitalize() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.capitalize(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.center 
	 */
	public static Function<String, String> center(final int size) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.center(input, size);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.center 
	 */
	public static Function<String, String> center(final int size,
			final char padChar) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.center(input, size, padChar);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.center 
	 */
	public static Function<String, String> center(final int size,
			final String padString) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.center(input, size, padString);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.chomp 
	 */
	public static Function<String, String> chomp() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.chomp(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.chop 
	 */
	public static Function<String, String> chop() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.chop(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.concat 
	 */
	public static Function<String, String> concat(final String s2) {
		return new Function<String, String>() {
			public String apply(String input) {
				if( input != null && s2 != null) {
					return input.concat(s2);
				} else {
					return null;
				}
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.defaultString 
	 */
	public static Function<String, String> defaultString() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.defaultString(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.defaultString 
	 */
	public static Function<String, String> defaultString(final String defaultString) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.defaultString(input, defaultString);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.deleteWhitespace 
	 */
	public static Function<String, String> deleteWhitespace() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.deleteWhitespace(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.difference 
	 */
	public static Function<String, String> difference(final String toString) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.difference(input, toString);
			}
		};
	}
	
	/**
	 * @see java.lang.String.format 
	 */
	public static Function<String, String> format(final Object... values) {
		return new Function<String, String>() {
			public String apply(String input) {
				return String.format(input, values);
			}
		};
	}
	
	/**
	 * @see java.lang.String.format 
	 */
	public static Function<String, String> format(final Locale locale,
			final Object... values) {
		return new Function<String, String>() {
			public String apply(String input) {
				return String.format(locale, input, values);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.left 
	 */
	public static Function<String, String> left(final int len) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.left(input, len);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.leftPad 
	 */
	public static Function<String, String> leftPad(final int size) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.leftPad(input, size);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.leftPad 
	 */
	public static Function<String, String> leftPad(final int size,
			final char padChar) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.leftPad(input, size, padChar);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.leftPad 
	 */
	public static Function<String, String> leftPad(final int size,
			final String padString) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.leftPad(input, size, padString);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.lowerCase 
	 */
	public static Function<String, String> lowerCase() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.lowerCase(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.lowerCase 
	 */
	public static Function<String, String> lowerCase(final Locale locale) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.lowerCase(input, locale);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.mid 
	 */
	public static Function<String, String> mid(final int pos, final int len) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.mid(input, pos, len);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.normalizeSpace 
	 */
	public static Function<String, String> normalizeSpace() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.normalizeSpace(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.overlay 
	 */
	public static Function<String, String> overlay(final String arg1, final int arg2, final int arg3) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.overlay(input, arg1, arg2, arg3);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.remove 
	 */
	public static Function<String, String> remove(final char c) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.remove(input, c);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.remove 
	 */
	public static Function<String, String> remove(final String s) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.remove(input, s);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.removeEnd 
	 */
	public static Function<String, String> removeEnd(final String end) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.removeEnd(input, end);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.removeEndIgnoreCase 
	 */
	public static Function<String, String> removeEndIgnoreCase(final String end) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.removeEndIgnoreCase(input, end);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.removeStart 
	 */
	public static Function<String, String> removeStart(final String start) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.removeStart(input, start);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.removeStartIgnoreCase 
	 */
	public static Function<String, String> removeStartIgnoreCase(final String start) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.removeStartIgnoreCase(input, start);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.repeat 
	 */
	public static Function<String, String> repeat(final int times) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.repeat(input, times);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.repeat 
	 */
	public static Function<String, String> repeat(final String arg1,
			final int times) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.repeat(input, arg1, times);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.replace 
	 */
	public static Function<String, String> replace(final String searchString,
			final String replacement) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.replace(input, searchString, replacement);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.replace 
	 */
	public static Function<String, String> replace(final String searchString,
			final String replacement, final int max) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.replace(input, searchString, replacement, max);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.replaceChars 
	 */
	public static Function<String, String> replaceChars(final char searchChar,
			final char replaceChar) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.replaceChars(input, searchChar, replaceChar);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.replaceChars 
	 */
	public static Function<String, String> replaceChars(final String searchCharsList,
			final String replaceCharsList) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.replaceChars(input, searchCharsList, replaceCharsList);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.replaceEach 
	 */
	public static Function<String, String> replaceEach(final String[] searchList,
			final String[] replacingList) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.replaceEach(input, searchList, replacingList);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.replaceEachRepeatedly 
	 */
	public static Function<String, String> replaceEachRepeatedly(final String[] searchList,
			final String[] replacingList) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.replaceEachRepeatedly(input, searchList, replacingList);
			}
		};
	}
	
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.replaceOnce 
	 */
	public static Function<String, String> replaceOnce(final String searchString,
			final String replacement) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.replaceOnce(input, searchString, replacement);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.reverse 
	 */
	public static Function<String, String> reverse() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.reverse(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.reverseDelimited 
	 */
	public static Function<String, String> reverseDelimited(final char separator) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.reverseDelimited(input, separator);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.right 
	 */
	public static Function<String, String> right(final int len) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.right(input, len);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.rightPad 
	 */
	public static Function<String, String> rightPad(final int size) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.rightPad(input, size);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.rightPad 
	 */
	public static Function<String, String> rightPad(final int size,
			final char paddingChar) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.rightPad(input, size, paddingChar);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.rightPad 
	 */
	public static Function<String, String> rightPad(final int size,
			final String paddingString) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.rightPad(input, size, paddingString);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.strip 
	 */
	public static Function<String, String> strip() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.strip(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.strip 
	 */
	public static Function<String, String> strip(final String stripChars) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.strip(input, stripChars);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.stripAccents 
	 */
	public static Function<String, String> stripAccents() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.stripAccents(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.stripEnd 
	 */
	public static Function<String, String> stripEnd(final String name1) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.stripEnd(input, name1);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.stripStart 
	 */
	public static Function<String, String> stripStart(final String name1) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.stripStart(input, name1);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.stripToEmpty 
	 */
	public static Function<String, String> stripToEmpty() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.stripToEmpty(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.stripToNull 
	 */
	public static Function<String, String> stripToNull() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.stripToNull(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.substring 
	 */
	public static Function<String, String> substring(final int start) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.substring(input, start);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.substringAfter 
	 */
	public static Function<String, String> substringAfter(final String s) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.substringAfter(input, s);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.substringAfterLast 
	 */
	public static Function<String, String> substringAfterLast(final String s) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.substringAfterLast(input, s);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.substringBefore 
	 */
	public static Function<String, String> substringBefore(final String s) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.substringBefore(input, s);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.substringBeforeLast 
	 */
	public static Function<String, String> substringBeforeLast(final String s) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.substringBeforeLast(input, s);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.substringBetween 
	 */
	public static Function<String, String> substringBetween(final String tag) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.substringBetween(input, tag);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.substringBetween 
	 */
	public static Function<String, String> substringBetween(final String arg1,
			final String arg2) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.substringBetween(input, arg1, arg2);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.swapCase 
	 */
	public static Function<String, String> swapCase() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.swapCase(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.trim 
	 */
	public static Function<String, String> trim() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.trim(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.trimToEmpty 
	 */
	public static Function<String, String> trimToEmpty() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.trimToEmpty(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.trimToNull 
	 */
	public static Function<String, String> trimToNull() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.trimToNull(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.uncapitalize 
	 */
	public static Function<String, String> uncapitalize() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.uncapitalize(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.upperCase 
	 */
	public static Function<String, String> upperCase() {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.upperCase(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.upperCase 
	 */
	public static Function<String, String> upperCase(final Locale locale) {
		return new Function<String, String>() {
			public String apply(String input) {
				return StringUtils.upperCase(input, locale);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.countMatches 
	 */
	public static Function<String, Integer> countMatches(final CharSequence sub) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.countMatches(input, sub);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.getLevenshteinDistance 
	 */
	public static Function<String, Integer> getLevenshteinDistance(final CharSequence arg2) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.getLevenshteinDistance(input, arg2);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.getLevenshteinDistance 
	 */
	public static Function<String, Integer> getLevenshteinDistance(final CharSequence arg2,
			final int arg3) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.getLevenshteinDistance(input, arg2, arg3);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.indexOf 
	 */
	public static Function<String, Integer> indexOf(final int searchedChar) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.indexOf(input, searchedChar);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.indexOf 
	 */
	public static Function<String, Integer> indexOf(final int searchedChar,
			final int startPos) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.indexOf(input, searchedChar, startPos);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.indexOf 
	 */
	public static Function<String, Integer> indexOf(final CharSequence searched) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.indexOf(input, searched);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.indexOf 
	 */
	public static Function<String, Integer> indexOf(final CharSequence searched,
			final int startPos) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.indexOf(input, searched, startPos);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.indexOfAny 
	 */
	public static Function<String, Integer> indexOfAny(final char... searchedChars) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.indexOfAny(input, searchedChars);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.indexOfAny 
	 */
	public static Function<String, Integer> indexOfAny(final CharSequence... searchedSequences) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.indexOfAny(input, searchedSequences);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.indexOfAny 
	 */
	public static Function<String, Integer> indexOfAny(final String searchedChars) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.indexOfAny(input, searchedChars);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.indexOfAnyBut 
	 */
	public static Function<String, Integer> indexOfAnyBut(final char... notSearchedChars) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.indexOfAnyBut(input, notSearchedChars);
			}
		};
	}
	
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.indexOfAnyBut 
	 */
	public static Function<String, Integer> indexOfAnyBut(final String notSearchedChars) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.indexOfAnyBut(input, notSearchedChars);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.indexOfDifference 
	 */
	public static Function<String, Integer> indexOfDifference(final CharSequence s2) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.indexOfDifference(input, s2);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.indexOfIgnoreCase 
	 */
	public static Function<String, Integer> indexOfIgnoreCase(final CharSequence searched) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.indexOfIgnoreCase(input, searched);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.indexOfIgnoreCase 
	 */
	public static Function<String, Integer> indexOfIgnoreCase(final CharSequence searched,
			final int startFrom) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.indexOfIgnoreCase(input, searched, startFrom);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.lastIndexOf 
	 */
	public static Function<String, Integer> lastIndexOf(final int searched) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.lastIndexOf(input, searched);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.lastIndexOf 
	 */
	public static Function<String, Integer> lastIndexOf(final int searched,
			final int startFrom) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.lastIndexOf(input, searched, startFrom);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.lastIndexOf 
	 */
	public static Function<String, Integer> lastIndexOf(final CharSequence searched) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.lastIndexOf(input, searched);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.lastIndexOf 
	 */
	public static Function<String, Integer> lastIndexOf(final CharSequence searched,
			final int startFrom) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.lastIndexOf(input, searched, startFrom);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.lastIndexOfAny 
	 */
	public static Function<String, Integer> lastIndexOfAny(final CharSequence... searchedSequences) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.lastIndexOfAny(input, searchedSequences);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.lastIndexOfIgnoreCase 
	 */
	public static Function<String, Integer> lastIndexOfIgnoreCase(final CharSequence searched) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.lastIndexOfIgnoreCase(input, searched);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.lastIndexOfIgnoreCase 
	 */
	public static Function<String, Integer> lastIndexOfIgnoreCase(final CharSequence searched,
			final int startFrom) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.lastIndexOfIgnoreCase(input, searched, startFrom);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.lastOrdinalIndexOf 
	 */
	public static Function<String, Integer> lastOrdinalIndexOf(final CharSequence searched,
			final int ordinal) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.lastOrdinalIndexOf(input, searched, ordinal);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.length 
	 */
	public static Function<String, Integer> length() {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.length(input);
			}
		};
	}
	
	/**
	 * @see org.apache.commons.lang3.StringUtils.ordinalIndexOf 
	 */
	public static Function<String, Integer> ordinalIndexOf(final CharSequence searched, final int ordinal) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return StringUtils.ordinalIndexOf(input, searched, ordinal);
			}
		};
	}
	
	public static Function<String, Byte> toByte() {
		return new Function<String, Byte>() {
			public Byte apply(String input) {
				return Byte.parseByte(input);
			}
		};
	}

	public static Function<String, Byte> toByte(final Byte defaultValue) {
		return new Function<String, Byte>() {
			public Byte apply(String input) {
				try {
					return Byte.parseByte(input);
				} catch (Exception e) {
					return defaultValue;
				}
			}
		};
	}
	
	public static Function<String, Short> toShort() {
		return new Function<String, Short>() {
			public Short apply(String input) {
				return Short.parseShort(input);
			}
		};
	}

	public static Function<String, Short> toShort(final Short defaultValue) {
		return new Function<String, Short>() {
			public Short apply(String input) {
				try {
					return Short.parseShort(input);
				} catch (Exception e) {
					return defaultValue;
				}
			}
		};
	}

	public static Function<String, Integer> toInteger() {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				return Integer.parseInt(input);
			}
		};
	}
	
	public static Function<String, Integer> toInteger(final Integer defaultValue) {
		return new Function<String, Integer>() {
			public Integer apply(String input) {
				try {
					return Integer.parseInt(input);	
				} catch(Exception e) {
					return defaultValue;
				}
				
			}
		};
	}
	
	public static Function<String, Long> toLong() {
		return new Function<String, Long>() {
			public Long apply(String input) {
				return Long.parseLong(input);
			}
		};
	}

	public static Function<String, Long> toLong(final Long defaultValue) {
		return new Function<String, Long>() {
			public Long apply(String input) {
				try {
					return Long.parseLong(input);
				} catch (Exception e) {
					return defaultValue;
				}
			}
		};
	}
	
	public static Function<String, Boolean> toBoolean() {
		return new Function<String, Boolean>() {
			public Boolean apply(String input) {
				return Boolean.parseBoolean(input);
			}
		};
	}

	public static Function<String, Boolean> toBoolean(final Boolean defaultValue) {
		return new Function<String, Boolean>() {
			public Boolean apply(String input) {
				try {
					return Boolean.parseBoolean(input);
				} catch (Exception e) {
					return defaultValue;
				}
			}
		};
	}
	
	public static Function<String, Float> toFloat() {
		return new Function<String, Float>() {
			public Float apply(String input) {
				return Float.parseFloat(input);
			}
		};
	}

	public static Function<String, Float> toFloat(final Float defaultValue) {
		return new Function<String, Float>() {
			public Float apply(String input) {
				try {
					return Float.parseFloat(input);
				} catch (Exception e) {
					return defaultValue;
				}
			}
		};
	}
	
	public static Function<String, Double> toDouble() {
		return new Function<String, Double>() {
			public Double apply(String input) {
				return Double.parseDouble(input);
			}
		};
	}

	public static Function<String, Double> toDouble(final Double defaultValue) {
		return new Function<String, Double>() {
			public Double apply(String input) {
				try {
					return Double.parseDouble(input);
				} catch (Exception e) {
					return defaultValue;
				}
			}
		};
	}
	
	public static Function<String, Date> toDate(final String... formats) {
		return new Function<String, Date>() {
			public Date apply(String input) {
				try {
					return DateUtils.parseDate(input, formats);
				} catch(Exception e) {
					return null;
				}
			}
		};
	}
	
	
	public static Function<String, Date> toDate(final Date defaultDate, final String... formats) {
		return new Function<String, Date>() {
			public Date apply(String input) {
				try {
					return DateUtils.parseDate(input, formats);
				} catch(Exception e) {
					return defaultDate;
				}
			}
		};
	}
	
	public static Function<String, Date> toDateStrictly(final String... formats) {
		return new Function<String, Date>() {
			public Date apply(String input) {
				try {
					return DateUtils.parseDateStrictly(input, formats);
				} catch(Exception e) {
					return null;
				}
			}
		};
	}
	
	public static Function<String, Date> toDateStrictly(final Date defaultDate, final String... formats) {
		return new Function<String, Date>() {
			public Date apply(String input) {
				try {
					return DateUtils.parseDateStrictly(input, formats);
				} catch(Exception e) {
					return defaultDate;
				}
			}
		};
	}
	
	public static <T extends Enum<T>> Function<String, T> toEnumValue(final Class<T> enumType) {
		return new Function<String, T>() {
			public T apply(String input) {
				return Enum.valueOf(enumType, input);
			}
		};
	}
}
